package com.logistics.delivery.entity.model;

import com.logistics.delivery.entity.domain.DeliveryAndPick;
import com.logistics.utils.aspect.annotation.Dictionary;
import com.logistics.utils.tool.StringUtils;
import lombok.Data;

@Data
public class DeliveryAndPickRow {

    private String code;

    private String pickCode;

    private String status;
    @Dictionary(key="delivery_status")
    private String deliveryStatus;

    private String container;
    @Dictionary(key="delivery_type")
    private String type;

    private String agv;

    private String priority;

    private String startStation;

    private String endStation;
    @Dictionary(key ="location_zone")
    private String zone;

    private String creator;

    private String createTime;

    private String updater;

    private String updateTime;


    public DeliveryAndPickRow(){}

    public DeliveryAndPickRow(DeliveryAndPick deliveryAndPick){
        this.code = deliveryAndPick.getCode();
        this.pickCode = deliveryAndPick.getPickCode();
        this.status = StringUtils.isNotNull(deliveryAndPick.getStatus())?deliveryAndPick.getStatus().toString():"";
        this.deliveryStatus = deliveryAndPick.getDeliveryStatus();
        this.container = deliveryAndPick.getContainer();
        this.type = deliveryAndPick.getType();
        this.agv = deliveryAndPick.getAgv();
        this.priority = StringUtils.isNotNull(deliveryAndPick.getPriority())?deliveryAndPick.getPriority().toString():"";
        this.startStation = deliveryAndPick.getStartStation();
        this.endStation = deliveryAndPick.getEndStation();
        this.zone = deliveryAndPick.getZone();
    }

    public static DeliveryAndPickRow build(DeliveryAndPick deliveryAndPick){
        return new DeliveryAndPickRow(deliveryAndPick);
    }

}
